<?php
namespace app\Admin\controller;

use think\Db;
use think\Session;

class Index
{
    public function index()
    {
        $uid = Session::get('uid');
        $data = Db::table('user_role')
            ->alias('ur')
            ->join('role r','r.rid = ur.rid')
            ->join('power_role pr','pr.rid = r.rid')
            ->join('power p','p.pid = pr.pid')
            ->where('ur.uid',$uid)
            ->select();
        $list = getTree($data);
        return view('index',['data'=>$list]);
    }

}
